package com.ruoyi.common.enums;

/**
 * 用户类型
 * 
 * @author lgq
 */
public enum UserType
{
    PLATFORM("内置用户","00"),PERSONAL_USER("个人用户","01"),COMPANY_USER("企业用户","02");

    private String userType;
    private String userKey;

    UserType(String userType, String userKey) {
        this.userType = userType;
        this.userKey = userKey;
    }


    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }

    public String getUserKey() {
        return userKey;
    }

    public void setUserKey(String userKey) {
        this.userKey = userKey;
    }

    public static String getKeyByType(String userType){
        UserType[] userTypeEnums = values();
        for (int i = 0; i < userTypeEnums.length; i++) {
            UserType userTypeEnum = userTypeEnums[i];
            if (userTypeEnum.getUserType().equals(userType)) {
                return userTypeEnum.getUserKey();
            }
        }
        return null;
    }
}
